<template>
	<view class="content" v-if="show==1">
		<view class="top">
		    <view class="top_1">
		      <view class="yue">
		        <view class="yue_1">
		          <view class="mingcheng">总余额</view>
		          <view class="qian"><text style='font-size: 1.3rem;margin-right: 5px;'>㉿</text>{{user.money}}</view>
		        </view>
		      </view>
		
		    </view>
		</view>
		<view class="dao" @click="url" data-url="/pages/user/chong" data-id="1">
			<image src="../../static/chong.png" class="tubiao" mode="aspectFit"></image>
			<view class="dao2">立即充值</view>
			<image src="../../static/right_2.png" class="tubiao2" mode="aspectFit"></image>
		</view>
		<view class="dao" @click="url" data-url="/pages/user/log" data-id="1">
			<image src="../../static/mingxi.png" class="tubiao" mode="aspectFit"></image>
			<view class="dao2">余额明细</view>
			<image src="../../static/right_2.png" class="tubiao2" mode="aspectFit"></image>
		</view>
		<view class="dao" @click="url" data-url="/pages/user/danye?id=3" data-id="1">
			<image src="../../static/shuoming.png" class="tubiao" mode="aspectFit"></image>
			<view class="dao2">余额说明</view>
			<image src="../../static/right_2.png" class="tubiao2" mode="aspectFit"></image>
		</view>
	</view>
</template>

<script>
	var app=getApp();
	export default {
		data() {
			return {
				show:0,
				uid:0,
				user:[],
				log:[],
				next:0,
				type:2,
				page:1,
				empty:0
			}
		},
		onShow() {
			const uid = uni.getStorageSync('uid');
			if(app.isBlank(uid)==true){
				app.error_msg("请先登录");
			}
			this.uid=uid;
			this.getdata();
		},
		methods: {
			getdata(){
				var that=this;
				
				uni.request({
				    url: app.globalData.url+"user/money",
					method:"POST",
					dataType:"json",
					header: {
					    'content-type': 'application/x-www-form-urlencoded'
					},
				    data: {uid:that.uid},
				    success: (res) => {
						uni.hideLoading();
						if(res.data.code!=1){
							app.error_msg(res.data.msg);
						}
						that.user=res.data.data.user
						that.show=1;
				    }
				});
			},
			url(e){
				var url=e.currentTarget.dataset.url;
				uni.navigateTo({
				    url: url
				});
			}
		}
	}
</script>

<style>
	.dao2 text{color:red;font-size: 0.7rem;margin-left: 5px;float: right;}
	.dao:last-child{margin-bottom: 10px;}
	.tubiao2{width:20px;height:20px;margin-top: 9px;}
	.dao2{width:100%;height:38px;line-height: 38px;flex:1;font-size: 0.95rem;color:#666;}
	.tubiao{width:25px;height:25px;margin-top: 6.5px;margin-right: 5px;}
	.dao{width:94%;padding: 3px 3%;display: flex;height:38px;border-bottom:1px rgb(245, 245, 245) solid;}
	
	.kong{width:100%;text-align: center;margin-top: 30%;}
	.active{border-bottom: 2px #05c160 solid;color:#05c160;}
	.qian2{width:40%;margin:0px 5%;height:30px;line-height: 30px;text-align: center;float: left;}
	.qian1{width:100%;overflow: hidden;}
	.bottom{width:94%;padding: 0px 3%;}
	.sign_1{width:100%;overflow: hidden;padding: 10px 0px;border-bottom: 1px rgb(245, 245, 245) solid;overflow: hidden;}
	.time{width:70%;float: left;height:50px;}
	.jifen2{width:30%;float: left;height:50px;line-height: 50px;color:rgb(7, 207, 33);font-size: 0.9rem;text-align: right;}
	.time_1{width:100%;height:30px;line-height: 30px;font-size: 0.8rem;color:#666;overflow: hidden;}
	.time_2{width:100%;height:30px;line-height: 20px;color:#999;}
	.red{color:red!important;}
	.top{width:94%;padding: 10px 3%;}
	.top_1{width:100%;height:auto;border-radius: 5px;background-image: linear-gradient(to right, #05c160 , #05c160);overflow: hidden;}
	.yue{width:100%;overflow: hidden;float: left;padding: 20px 0px;}
	.yue_1{width:100%;}
	.yue_2{width:30%;float: left;text-align: right;margin-top: 13px;}
	.mingcheng{width:100%;height:20px;line-height: 20px;color:#eee;text-align: center;}
	.qian{width:100%;height:35px;line-height: 35px;color:#fff;font-size: 1.5rem;overflow: hidden;text-align: center;margin-top: 10px;}

	
</style>
